<%--
  @desc: 应用列表首页
  @author: chenw
  @create: 2014-4-29 下午 15:32
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="pageHeader">
    <form rel="pageForm" onsubmit="return navTabSearch(this);" action="<c:url value='/log/accesslog'/>"
          method="get">
        <div class="searchBar">
            <ul>
                <li style="float: left;line-height: 25px;">
                    <label style="width:60px;">统计时间：</label>
                    <input id="start" name="start" type="text" class="date" dateFmt="yyyy-MM-dd 00:00:00"
                           value="<fmt:formatDate value="${query.start}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                           placeholder="起始时间"
                           style="width:100px;font-family:'微软雅黑 sans-serif serif';"/>
                    -
                    <input id="end" name="end" type="text" class="date" dateFmt="yyyy-MM-dd 23:59:59"
                           value="<fmt:formatDate value="${query.end}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                           placeholder="结束时间"
                           style="width:100px;font-family:'微软雅黑 sans-serif serif';"/>
                </li>
                <li>
                    <div class="buttonActive" style="margin-left: 5px;">
                        <div class="buttonContent">
                            <button type="submit">查找</button>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="buttonActive" style="margin-left: 5px;">
                        <div class="buttonContent">
                            <button type="button" onclick="exportExcel()">导出</button>
                        </div>
                    </div>
                </li> 
            </ul>
        </div>
    </form>
</div>
<div class="pageContent" style="padding-top: 1px;">
    <table class="table" width="100%" layoutH="78">
        <thead>
        <tr>
            <th width="150">应用名称</th>
            <th width="100">使用量</th>
            <th width="100">下载量</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach var="access" items="${list}" varStatus="vs">
            <tr>
                <td align="center">${access.appName}</td>
                <td align="center">${access.useCount==null?"-":access.useCount}</td>
                <td align="center">${access.downCount==null?"-":access.downCount}</td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
<script type="text/javascript">
	function exportExcel(){
		location.href="<c:url value='/log/exportExcel.xls?start="+$("#start").val()+"&end="+$("#end").val()+"'/>";
	}
</script>

